Change: check document when loading reference