minor error while iterating