error checking getDepartment