Add extension check before getting size