implement changeMode