ensure file exists before indexing