function registerRelay is invoked by clicking button
aaaa