added setMode