Added command line option for url. Also added more checks