fixed issue with pass-by-reference loop