Trying to do stream redirection properly