adding a autoscroll function which scrolls down the chat messages when some new messages arrives
improving some details