fix bug ,optimization code

fix bug ,optimization code