add init function to next containing scope that has var of same name or global otherwise