fix lambda bug (thanks @vgeddes)