fix lambda capture bug