improved gui_msg_app detect. done some cleanup