fix: logic of extracting file extension.