Added caching on database