added try/catch clause, to purge cache when courses have been deleted