better handling of file URLs