trying to fix redirect loop