fix for  O(n^2) index lookup
model update