fixed redirectUrl generation