fix stdout redirection