Fix issue on redirect function.