Fixing run with gateway and Error custom definition