Fix the event dup prevention query.

I accidentally checked all events, not the particular service's events.