conditionally execute js to find user location