Cancel wait_flag; add auto login_status check.