fixed syntax error checking for user agents