Fixed error in index view if list is empty