modified sort logic for candidates list