Fix document order