fixed logic for bad results