Fix trace error bug