update script with checks to skip unnecessary files