script: add hack to deal with regex_handler teardown