added condition to filter repeated events.. it's slow, so should be modified