Fix ClassCastException