added the feature of listen public events