fix document check