scrollToBottom JS made into a function + added to sendMessage JS