complete add course function