exiting the program now stops msg event thread (which made it slower to quit when debugging)