fix some bugs

still have some bugs