fix vote bug in JS