trying solutions found online, matches exact problem, solves with additional code under app/models/pin.rb file