Adding last logical code to make leader election run properly.