Fix bug with local variable