Added check before delete to make sure the object exists in db