fixed logic oops