adding check for navigator object in geolocation.js