resolve redirect loop