fixed lambdas to use closures