fixed a bug in subdept addition.