change code by miao