added support for closures