Fix bug with event