speeded up the feature vector length checking