diff --git a/include/class.ticket.php b/include/class.ticket.php
index 9c0181fcd5be2c894a27643800a319c6421807e7..4b19339fcd652fb1acb3ea20259dfc027b19566d 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -2636,6 +2636,9 @@ implements RestrictedAccess, Threadable {
         if ($errors)
             return false;
 
+        // Decide if we need to keep the just selected SLA
+        $keepSLA = ($this->getSLAId() != $vars['slaId']);
+
         $this->topic_id = $vars['topicId'];
         $this->sla_id = $vars['slaId'];
         $this->source = $vars['source'];
@@ -2667,9 +2670,6 @@ implements RestrictedAccess, Threadable {
         if ($vars['note'])
             $this->logNote(_S('Ticket Updated'), $vars['note'], $thisstaff);
 
-        // Decide if we need to keep the just selected SLA
-        $keepSLA = ($this->getSLAId() != $vars['slaId']);
-
         // Update dynamic meta-data
         foreach ($forms as $f) {
             if ($C = $f->getChanges())