[MODIFY] integrate two functions for registering callback
[MODIFY] handle event for StreamListener connected