change sync to async