Added additional check for closures