fix error on redirect