fix timing bug, await in wrong place. fix npe risk