Updated the BeginSend and MessageSent with code