document saving improvements