updating scripts function