fixed bug in tvar