fixed auth and redirect issues