rewrote leader elect -> still not working