added select candidate function