fixed local variable error