support lambdas in threads