removed unnecessary object cast code