add parity checking