chat box implementation