ReferenceError: location is not defined