Handle chat messages properly