applied patch for redirect loop issue