error in courseIndex

due to the array type of department; just leave department to single
choice