update $location, $rootScope