Checking for duplicate events and events too close in time