added workaround for location redirect loop