 <p>Found the issue and it was very minor, I was removing everything with a class of default which was being removed every time a state changed, so now it will remove everything with class tile and prevent any duplicate containers.</p> <pre><code>socket.on("presenceusers", function (userPresence) { $('.tile').remove();\\ &lt;------ for (var i = 0; i &lt; userPresence.length; i++) { if (userPresence[i][1] === "enable") { $presence.append('&lt;div class="col-md-2 md tile default"&gt;&lt;h6&gt;&lt;img src="../images/offline.png"&gt;&lt;b&gt;' + userPresence[i][0] + '&lt;/b&gt;&lt;/h6&gt;&lt;/div&gt;'); } } }); </code></pre>