added getMessages function and box for chat to appear in