Resolve bug of scheduleOnce