check if the file exists first... fixes #26