Throw exception in case URL is not valid