fix incorrect operations order in WAL