main threads use lambda functions