Added user agent switching based on page length