fix strange stack corruption