Fixed issue: list index out of range