fixed lambdas and tests