Update script to check extension