fix output redirect