Remade delete button handler