checked the candidateList before printing in toString()