change test and code to async