fixed logic again