fixex some bugs