fix method of splitting file names to be compatible with Windows