moved user agent detection in gem