fixed some asynchronous issues