prevent class cast exception