Write to the correct pipes