checking each department