using lambda function instead of member function