How to check the existance of the object in the program?