fixed some bugs;