move debug code to where it was intended