fixed the extendFeatures function