named function handling message from client