ensure object is present before trying to remove it