modify to allow async usage