add event handler to switch room