make relay.c work for state command