altered browser detection (previously not working correctly)