fix bug in featureDetection