implemented subscribe event handler.