Fixed events bugs