fixed the authentication for routes