add trace view code