Close file when during init of sync