Fixed scrolling issues thanks to code from node_chat