Error redirect loop fixed