Fixed a dom timeing issue with the router.