fix and or functions bug