fix lost writes at crucial point