fix some defects