fixed ClassCastExceptions