adding message logic to server