better uri handling for script interface