fix variable scope (version 0.3.1)

Before this change, the variables behave like static

Change-Id: I4af1034a3ccfb822d6b4e0474bb6ba9a90c43be1