Added fix to course filtering. However, need to refactor for performance