fixed let optimization in closures issue