Fixed bug with quality selection

Unsorted lists  weren't returning the correct value