Modify delete so it removes the wallet before writing to it, so it works now.