append script function