Updated controller to check location before relying on lat/lon