try to fix some bugs