Changed the way the exit dialog works