Fix local variable problem. close #7