fixed logic error: sum_of_unsettled