Wait until files are closed