reinitialize an instance of the function on each worker run