Adding error-checking to create_url_spec()