fix nasty bug caused by private inheritance of std::exception