loop/closure fix