fixed scope of variables