modified to use async library