Fixing the update_group_id function