Trace to fix resource bug