small problem with printing debug code where it shouldnt.