Added null or empty check to url for url parsing