Fixing error on redirect