Logout not redirecting properly