added stdout redirection from child to parent via pipes