fix bug in tr controller