another attempt to fix $location dependency