fix #22 Add check to ensure URL and URL is not empty