Adjust gateway code