backup: quote var $i when passing it to function