renamed function to write_entry_file to be more specific
dont try to delete index file if doesnt exist