added code to save feature terms