added debug code