rename $sid to $gid #2797