Function deleteObject