previous change was buffy - used the wrong value for the index in the storage, which was producing unexpected behaviour