add some debug code to track down bug