fix a bug in feature caching