debug why on_quit is called