Fix reloading of page not scrolling to the bottom of the chat
Code cleanup