refactored to enable sending messages from client socket