fixed issue with duplicate name
added some debug code