diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js
index ba6f918df..8c80c4eb3 100644
--- a/files/assets/js/chat.js
+++ b/files/assets/js/chat.js
@@ -82,6 +82,9 @@ socket.on('speak', function(json) {
document.getElementsByClassName('avatar-pic')[0].src = json['avatar']
if (json['hat'])
document.getElementsByClassName('avatar-hat')[0].src = json['hat'] + "?v=3"
+ else
+ document.getElementsByClassName('avatar-hat')[0].removeAttribute("src")
+
document.getElementsByClassName('userlink')[0].href = '/@' + json['username']
document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor']
document.getElementsByClassName('time')[0].classList.remove('d-none')
diff --git a/files/templates/chat.html b/files/templates/chat.html
index bd81357c9..9ab09ad41 100644
--- a/files/templates/chat.html
+++ b/files/templates/chat.html
@@ -222,6 +222,6 @@
-
+