             queuePosLabel.text = "\(aheadOfYou)"
         }
         
-        if aheadOfYou == 0 {
+        if aheadOfYou == 0 && !pending {
             setPending()
         }
     }
 
     
     func setPending() {
+        pending = true
+        active = false
         queueEstimateLabel.isHidden = false
         queuePosLabel.isHidden = true
         urgentButton.isHidden = true

    }
    
    func setActive() {
        queueEstimateLabel.isHidden = true
        queuePosLabel.isHidden = true
        centerImage.image = UIImage(named: "center_in")
    }
    
    func setInActive() {
        centerImage.image = UIImage(named: "center")
        queueEstimateLabel.isHidden = false
        queuePosLabel.isHidden = false

    @IBOutlet weak var centerImage: UIImageView!
    
    var inQueue = false
    var pending = false
    var active = false
    var aheadOfYou = 3
    var queueSize = 3
    var karmaPoints = 85
