fix errors in throw code