handle delete correctly