some bugs fixed
merge