Added caching for flows