throw error when pipe in stream