redirect as necessary