Added try/catch to control exceptions caused by wrong syntax.