fix a real_ts variable ref bug