Fix circular redirect issue