Changed the check to see if an object can be deleted