Fixed PIPE issue with forking