Add extension detection