delete function issue