modified pin.rb and user.rb