fix for ClassCastException