add logic for candidate