Added environmental check for print statements