Make sure files are created before stopping