fixing up logic for redirect vars