Added checking for print on and echo on