error in boolean logic