Add loading logic to homepage to make it work more reliably.