Shouldn't this be TARGETURI?  Because when you use the target_uri function, it specifically retrieves the URL from datastore['TARGETURI']