added functionality to delete courses properly