fixed class cast exception for long