fixed boolean logic