Refs #5533 try threads with fitting moved inside function
Refs #5533 fix merge conflict