Control charactors being printed in console

Added a try catch block, see if it stops the control codes being printed
in console