fixed some bugs
merge