fix the vote sql