with debug code