fixed wrong file format when doubled extension