corrected some bugs
merge from dev