fix to async code