worked on delete function