update gateway.js