better logic for handing u-url

Signed-off-by: Eric Nakagawa <ericnakagawa@gmail.com>