Use $interval instead of window.interval