fixed bugs in fragment caching