update_department bug fixing