changed db usage to by async