set proper on and off times