Add CheckRedirectFunction