fix auto redirect