using startInterval to schedule execution