Bugfix. Previous commit didn't take closed chat boxes into consideration