added some debug code