added caching for related magic space