stack bug fix