add try catch to boolean expression