fixed logic from and to or