fix message generator for rpc
needs testing