better exception hierarchy, also fixed issue when running training