Improved input check for voting