setPrimaryitem logic