save the proper last index not just random stack garbage