Fixed bug in location.js