Made function for deleting objects that may not exist