update gateway.cc