restore inGuiThread flag
small cleanup