fix lambda,error check