fix batch1
(index nil value errors)