closures now working with captured environment