test code for subscribe to event