Added single gateway support
Added multiple gateways support