adding trace functionality.