Fixing bug with file naming