Made some changes. Made it better by making it try and continue the index.