added EXIT_ON_CLOSE