detecting mechanism