fixed debug code