potential problem with names causing exception

key gen leads to sample state changing, sort by sample state changing
sorting by last sample state changed