Fixing way to generate filename