Regarding enforcement of specific performance act

I had purchased a flat at Bangalore and registered in my name and took possession also. In the meanwhile I received a notice stating that the said flat was sold to someone earlier and the contractual obligation has not been completed by the developer and added my name in the fourth place by joining with developer i had managed to get registred the said property in my name. The sad fact was not known to me before entering into an agreement. The developer was known to us and we have not checked much about the project. But on enquiry we came to know that this particular fat they had entered an agreement with someone who paid some advance and balance he could not pay in time. Subsequently they sent notice thru their lawyer stating the said agreement is cancelled and his advance would be refunded to him thru their appointed lawyer. Right now I am holding registered deed in my name and also they issued possession certificate and key last month. May I know the merit of the title deed I am holding?