adding debug code to narrow down position of a problem.