Fix events bug