fixed ref tracing
fixed initialization