fixed indexing error in ItemController persist method