Added a new function named die_on_unsafe_path(). This is used