fix for out of idnex crash
Merge pull request #2 from dostapenko/master

fix for out of index crash