fixes ClassCastException