troubleshooting delete function issue