fflush(stdout) should not be always called