fix error in reply.rb logic