fix for redirect loop