fix gateway server detection (reported by ytswy)