Fixing invalid course filtering