fix turn on/off bug