fix to SQLcurrent not deleting before being written