Use locate instead of custom javascript