fixed wrong writes