Added trace logging