fixed logic issue where it would ignore the first entry