fixed to work with file protocol