Move the determineOutput to fix deadlock

The determineOutput function is deferring a message write about the
output, with the watching go routine waiting til after that to get
started, it deadlocks.