avoid IndexError in listModel, related to #449, #518