Fixed lambda expression to pass by reference