Fixed document save