fixed: IndexError: list index out of range