added logic for parsing messages from the client