fixed logic errors