correcting casting - error==float was commented out