Add handling for writing to STDOUT