define a restart function in Oscillator