Put stdin flushing in the correct spot