added assert fail on ClassCastException