fixed infinite loop when no qualities