add more debug code