removed unnecessary extension check