stdin and stderr redirection were not working