error handling in pipe()