fix object cast exception