updating logic for chain_id in command. bug when chain_id == 0 (no test to prove it)