Fixing events bug