adding trace logging