preventing empty groups from being broken on reordering