issue with delete function solved