change another way to fix lambda function issue in gcc 4.7