gateway: fix a revert problem