fix routes and redirects