This looks weird to me given that you unlink the file a few lines above