writing file to remove