Update on_connected.rb

bug fix