Fixed the jQuery event bug