fixed errors introduced by location.js