Refactored to use $scope.go() instead of $location.path() for redirect