implement mode change