Adding console.writeline and try/catch