Determining accurate measurements of the growth rate from the galaxy correlation function in simulations