inmproved delete method