fixed some defects