Added additional check to verify group order is retained