testing and fixing kgScript