fix extension parsing