added better chat message and error handling/logging