fix bug with class type
fix wrong type exception message