ensure only valid URIs are passed to the constructor