[issue 294] fixed the list index out of range issue