fixed some bug about cad