fixes to server when sending messages