add "var" in front of some local vars