redirect process output to file to avoid freeze that happens in some cases