use setTimeout instead of interval.