updated file-extension handling