fixing auto redirect