Improved the detection method