Auto redirect bugfix.

Fixing infinite loop