Automated machinery and robots working with humans are the norm in modern smart industries. A previous work in this area proposed a tool for improving the safety of such work places: an emergency system which halts those machines that are visible from an emergency stop button when it is pressed [1]. The solution presented in this paper improves the reliability of the aforementioned one at the expense of a higher computational complexity. Furthermore, two algorithmic optimizations are presented to mitigate the extra computational cost as it is shown by the results collected from the set of experiments conducted.