fix bug, function tr