fix extension check bug