fix success typo, added error handler