applied changes from NodeBB/fb2b54b31462eed8d22d524aa7254faa9aa98db5