fix local variable problem