handle scripts properly