update chat.rb
ok, it kinda works