local variable problem fixed