Bridge with ESP-12 and 3 ESP-01

Hi, I use the function bridge with an ESP-12 which controls 3 ESP-01 (each command a relay). This works well, but the problem comes when an ESP- 01 is not connected anymore (whatever the reason), so the main program on the ESP-012 is blocked (commands are not active anymore) with the message "your esp8266 is not connected ". This is very problematic because all commands of the project no longer work. I use such basic described in aid programming.
Is this a bug ? or I have not found how to detect that an ESP is disconnected…
Thank’s for your help.

Please give more info of what is wrong. I didn’t understand anything.

Hi Dmitriy,
Here is below sketch for the ESP-12 and sketch for one of the ESP-01 (two other are the same):
As I do not know how to join a file I change .ino etension to .jpg extension
1) ESP-12

2) ESP01

My problem : If ESP-12 and 3 ESP-01 are ON and online, all run perfectly. If I switch OFF one of my ESP-01, for example ESP-01-2, so I have on my phone the message “your ESP8266 is not connected” and I can do nothing anymore; for example press button, corresponding to ESP-01-3 (which is still ON), is inactive. Now I switch ON the ESP-01-2 and so all work again.
I hope my explanation are clearer.