Fixing user agent check