added check for redirect url