fixed output redirection