fixed a minor writer bug