detect operation mode