Changed redirect implement to prevent dead loop on browser's history.back()