some bugs fixed, but not all of them