On the regularity of solutions to the Navier-Stokes equations