fix a crash problem when self.URL is nil & add support for file:// scheme