fixes file document merge error.
i should write more tests.