fix nested closures