fix for small issue in folding tagbased documents