handling closed pipe done