fix bug with expected class type