conditional DELETE

cbugg: close bug-638