invalid token check on redirect