Fix the bug with redirect to sign in page