added logic to flag deleted courses and hide the courses themselves