fixed overflow problem when adding too many different units