change from sync to asynchronous