corrected fnction call order in task_manager::main