dealt with index errors in consumer