fixed error in mode selection