change apply to $location.replace() into setCC function and remove $apply() add console