added some trace logging