setting delete function bug fix