Omitting print statements stops program working

Post the complete sketch, your problem is probably in the variable declaration but that's just a wild guess.