Attempting to fix redirect loop