bug fix on pin.rb