Wrong boolean logic