prevent ClassCastException