finish document