properly handle boost::bad_lexical_cast exceptions