This logic is performed here and in ```_setup_debug_trace```- are both necessary?