Adding optionargument to setGateway method