Move it to the finish function because it is the only place we call the function.