Update ElectionThread.java

Solved electionThread issue.