remove old files, move temp file to index