Added foreign event exclusion.
Fixed the duplicate function of Events