fix class cast exception