improve voting function

improve voting function