Changed data.js to be more safe and work more directly with updateLocation event