fixed bug when using temporary file and writing to stdout (crashes)