updated indexing code for hosted