Fixed async code, added pending count