Document snapping & bug fix with documents history