catch io erros when pipe close