Fixed to clear out the threads list and actually invoke the function