detect mode