Cleaned, added browser detection check