fix  some bugs