fix index by for cached models
Merge pull request #2 from anton-github/master

fix index by for cached models