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