Bug fixing duplicate events