fixed some bugs

fixed some bugs