added newline handling to URI caching