added more debug code