Fixes issues when load a same document id in onloaded callback