fix for item index bug -- need to check value of 'previous' when deciding where values should start