Closed #176 currentDocument must be an helper instead of variable

Problem with cache.