fixing parity bug