invert bad logic