Add error checking for voting and fix select bug