updated SGScript for cppbind memory usage fix