fix tracing check outside of functions