fix group sorting issue