fixed for new on_error interface