fixed bug with user agent detecting