Add check for department existence