Better done globally here in the function.