fix lambda to function conversion