added logic so that user is only able to edit/add pins  if logged in