fixed bug in voting logic