fixed class cast and number format exception