I've reimplemented this part please check now. Now first monitor node will be always the controller node