fix bug in advanced mode with user agent

fix bug in advanced mode with user agent