Do not use "var" multiple times in function