Fixing delete course see #6183