fixed a race condition in the --delete handling code. The bug led to