Fix bug on refresh redirecting to /login