bugs fixed in election mechanism