Changed caching to be after the db query