Added setIndex to memeory handler