Added exception handling to handle System.QueryException when doing SOQL
compile check