Fix events and fix bug about error handling...