set err, out of result to env