fix bug in t-function for isdefined()