do refactor and fix cannot create course bug.