make sure ip whitelist has length before redirecting