Added more checks
Modified to accept --url argument