Electric fence will work even when you are not there, and to some extent will work even when it isn't on after the local wildlife has been trained to avoid it. We put peanut butter on the fence in the spring.
A 4-yo is smart and will learn quickly not to touch the fence. Our young birds learn quickly that the fence can hurt while they cannot fly, and now as adults stay inside the 42" high fence even though they can fly over it.
Of course, when our fence was first installed, I caught the eldest boy paying the youngest boy to touch the fence, which he did, and everyone learned about the fence. No permanent damage to anyone. Make certain the fencer is is intermitant, where it zaps, then rests and zaps again. This give any thing in contact a quick jolt, then a chance to get away.
Very sorry for your losses. Good luck with ways to keep them safe in the future.