how can i dynamically change the gateway?