improved the code of async sending