fixed some bugs after test