fixes the bug that document.cache has been removed unexpectedly; fixes #1