URL check was not reliable for urls that included special chars like '~'. using node's url module to help identify if it's a url.