add var type checking in setup
merge from latest master