hardened stack logic