improve cast error message