minor improvement on detectFeatures