* adjust code for edit dept.
 * fix bugs.