Updated extension detection