refactor dispatchers
join threads instead of looping infinitely