Fix event bug