Changed how we add files to the index. There is a exit hook that writes the file on exit