change apply to $location.replace() into setCC function