fix a bugs of missing code.