hopefully fixed scope memory stack