run_in_background: fix execution when debug mode is enabled