some bugs caused by merging corrected