closure for " for loop fix"