better output
fix error detected by valgrind
fix bug on struct task_t