added try/catch around cmp