before exiting wait for the last msg to be sent