fix some bugs of debug