added proper blocking to pipes
removed a debug message