some bugs fixed
fix conflicts before merge