diff --git a/php/classes/BaseManager.php b/php/classes/BaseManager.php
index 62a8851..c3b23f4 100644
--- a/php/classes/BaseManager.php
+++ b/php/classes/BaseManager.php
@@ -103,14 +103,15 @@ class BaseManager
 	*/
 	public function addFile($fileName, $start = null, $stop = null) 
 	{
-	   // standard file upload : start / stop get from file
+	  
+	  // standard file upload : start / stop get from file
 		if (!$start)
 		{
 			$fileDom = new DomDocument("1.0");
 			$fileDom->load($this->fileDomName);       
 			$file = $fileDom->getElementById($fileName);
 			$start = $file->getAttribute('start');
-			$stop = $file->getAttribute('stop');
+			$stop = $file->getAttribute('stop');			
 		}
 		
 		$lastMask = null; 
@@ -280,7 +281,10 @@ class BaseManager
 		$newVi->appendChild($this->baseDom->createElement("mask",$fileMask)); 
 		$this->appendFiles($newVi, $fileMask);
 		
-		$this->baseDom->documentElement->appendChild($newVi); 
+		$this->baseDom->documentElement->appendChild($newVi);
+		
+		 /* SORT files by Start Time */         
+		$this->xslt->transformToDoc($this->baseDom)->save($this->baseDomName); 
 		return $newId;            
 	}
  
--
libgit2 0.21.2