Fix bug with gateway.js