Fixed the stdout pipe issue