Fixed "Uncaught ReferenceError: $location is not defined"