fixing bug on iterations (not converted to int)