fixes to handle URL and files the same way.