Merge pull request #28 from 30x/XAPID-656

fixed panic, added in-mem cache for scopes