Fixing duplicate events