fix some bugs
but still leave a lot