Fix $location missing issue