fixed class cast exception