Altered to use task manager