fix typeerror caused by async loaded code file