Fix events handling