added some debug traces for testing