Index: /temp/trunk/html/admin/design/main_edit.php
===================================================================
--- /temp/trunk/html/admin/design/main_edit.php	(revision 3725)
+++ /temp/trunk/html/admin/design/main_edit.php	(revision 3726)
@@ -334,8 +334,9 @@
 		mkdir(dirname($path));
 	}
+
+	unlink($path);
 	
 	if(file_exists($path)){
 		sfprintr($_POST['tpl_data']);
-		unlink($path);
 	};
 	
@@ -343,4 +344,4 @@
 	$fp = fopen($path,"w");
 	fwrite($fp, $_POST['tpl_data']);
-	fclose($fp);	
-}
+	fclose($fp);
+}
