add t_ref for error reporting