Added try catch on parsing the queries as well