Added quick fix for redirect loop issues