read index from file if it exists