added settings variable to control caching