fixed delete button functionality