Added check for duplicate department name