detect user agent and redirect accordingly