Fixed issue where exiting from chat would not be recognized until next System.out call