fix a some bugs