fixed double document bug