use lambda function to get latest value