add pointer to index, fix snippet bug