added stdout redirection