location resolver code