added as-gateway hook