added view and edit logic checks to pin index