Improved delete button code.