corrected a bug
merge from debug