Added detach and askName in gateway.