unguarded debug printf. added the appropiate if statement