Fixed event deduplication and added optional logger to event object