Added ability to have multiple periodic threads