use $interval service instead of setInterval