catches error in courses post