table sorting was overwriting the groups we were saving