improve delete handling