add more informative exception and regression test