fixed a mistake causing write to stdout