added detect method