modified delete method