Deleted the offending lines "index = index + 1" when .status$ = "rejected".