fixed deleting... but an interesting bug exists - can you spot it?