Added option to enable/disable the sorting of groups