var scoping in alterType