Fixed event binding bug