Made dup2 get called before the exec, which made stdout redirection worked