added caching for database reads