Fixed error when retrieving courses