fix bugs and add gold script