Bugfix. Needed to set the list length after foreach (if entries are less than 10)