add traces
fix null pointer