Updated filename handling